package com.newlink.building.common_base.widget

import android.app.ProgressDialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import com.newlink.building.common_base.R
import android.widget.TextView


/**
 * Created by xiaodong on 2023/5/10.
 */
class WaitProgressDialog(context: Context) :
    ProgressDialog(context, R.style.WaitDialogTheme) {

    var mMessage = ""
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        window?.setGravity(Gravity.CENTER)
        setCancelable(true)
        setCanceledOnTouchOutside(false)
        setContentView(R.layout.wait_dialog)
        val centerText = findViewById<TextView>(R.id.wait_message)
        centerText.text = mMessage
    }

    open fun setMessage(message: String) {
        this.mMessage = message
    }

    override fun show() {
        super.show()
    }

    override fun dismiss() {
        super.dismiss()
    }
}